home *** CD-ROM | disk | FTP | other *** search
Wrap
<refentry id="libgimp-gimphelpui" revision="19 Jan 2001"> <refmeta> <refentrytitle>gimphelpui</refentrytitle> <manvolnum>3</manvolnum> <refmiscinfo>LIBGIMP Library</refmiscinfo> </refmeta> <refnamediv> <refname>gimphelpui</refname><refpurpose>Functions for setting <link linkend="GtkTooltips">GtkTooltips</link> and HTML links into the GIMP help system.</refpurpose> </refnamediv> <refsynopsisdiv><title>Synopsis</title> <synopsis> void (<link linkend="GimpHelpFunc">*GimpHelpFunc</link>) (const <link linkend="gchar">gchar</link> *help_data); void <link linkend="gimp-help-init">gimp_help_init</link> (void); void <link linkend="gimp-help-free">gimp_help_free</link> (void); void <link linkend="gimp-help-enable-tooltips">gimp_help_enable_tooltips</link> (void); void <link linkend="gimp-help-disable-tooltips">gimp_help_disable_tooltips</link> (void); void <link linkend="gimp-standard-help-func">gimp_standard_help_func</link> (const <link linkend="gchar">gchar</link> *help_data); void <link linkend="gimp-help-connect-help-accel">gimp_help_connect_help_accel</link> (<link linkend="GtkWidget">GtkWidget</link> *widget, <link linkend="GimpHelpFunc">GimpHelpFunc</link> help_func, const <link linkend="gchar">gchar</link> *help_data); void <link linkend="gimp-help-set-help-data">gimp_help_set_help_data</link> (<link linkend="GtkWidget">GtkWidget</link> *widget, const <link linkend="gchar">gchar</link> *tooltip, const <link linkend="gchar">gchar</link> *help_data); void <link linkend="gimp-context-help">gimp_context_help</link> (void); </synopsis> </refsynopsisdiv> <refsect1> <title>Description</title> <para> </para> </refsect1> <refsect1> <title>Details</title> <refsect2> <title><anchor id="GimpHelpFunc">GimpHelpFunc ()</title> <programlisting>void (*GimpHelpFunc) (const <link linkend="gchar">gchar</link> *help_data);</programlisting> <para> This is the prototype for all functions you pass as <parameter>help_func</parameter> to the various GIMP dialog constructors like <link linkend="gimp-dialog-new">gimp_dialog_new</link>(), <link linkend="gimp-query-int-box">gimp_query_int_box</link>() etc. </para> <para> Note that all help paths are relative to the root of the help system in the current language. So if your language is "C", a help path of "filters/foo_bar.html" will expand to "${gimp_data_dir}/help/C/filters/foo_bar.html". </para> <para> All these functions finally call <link linkend="gimp-help-connect-help-accel">gimp_help_connect_help_accel</link>() which does the work of installing the "F1" accelerator. </para> <para> In most cases it will be ok to use <link linkend="gimp-plugin-help-func">gimp_plugin_help_func</link>() which does nothing but passing the <parameter>help_data</parameter> string to <link linkend="gimp-help">gimp_help</link>(). If your plug-in needs some more sophisticated help handling you can provide your own <parameter>help_func</parameter> which has to call <link linkend="gimp-help">gimp_help</link>() to actually display the help. </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>help_data</parameter> :</entry> <entry>A string containing the path to a HTML page. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-help-init">gimp_help_init ()</title> <programlisting>void gimp_help_init (void);</programlisting> <para> This function initializes GIMP's help system. </para> <para> Currently it only creates a <link linkend="GtkTooltips">GtkTooltips</link> object with <link linkend="gtk-tooltips-new">gtk_tooltips_new</link>() which will be used by <link linkend="gimp-help-set-help-data">gimp_help_set_help_data</link>().</para> <para> </para></refsect2> <refsect2> <title><anchor id="gimp-help-free">gimp_help_free ()</title> <programlisting>void gimp_help_free (void);</programlisting> <para> This function frees the memory used by the <link linkend="GtkTooltips">GtkTooltips</link> created by <link linkend="gimp-help-init">gimp_help_init</link>().</para> <para> </para></refsect2> <refsect2> <title><anchor id="gimp-help-enable-tooltips">gimp_help_enable_tooltips ()</title> <programlisting>void gimp_help_enable_tooltips (void);</programlisting> <para> This function calls <link linkend="gtk-tooltips-enable">gtk_tooltips_enable</link>().</para> <para> </para></refsect2> <refsect2> <title><anchor id="gimp-help-disable-tooltips">gimp_help_disable_tooltips ()</title> <programlisting>void gimp_help_disable_tooltips (void);</programlisting> <para> This function calls <link linkend="gtk-tooltips-disable">gtk_tooltips_disable</link>().</para> <para> </para></refsect2> <refsect2> <title><anchor id="gimp-standard-help-func">gimp_standard_help_func ()</title> <programlisting>void gimp_standard_help_func (const <link linkend="gchar">gchar</link> *help_data);</programlisting> <para> This is the standard GIMP help function which does nothing but calling <link linkend="gimp-help">gimp_help</link>(). Please use <link linkend="gimp-plugin-help-func">gimp_plugin_help_func</link>() for your plug-in's help links. </para> <para> Currently, <link linkend="gimp-standard-help-func">gimp_standard_help_func</link>() and <link linkend="gimp-plugin-help-func">gimp_plugin_help_func</link>() do exactly the same. The latter one was introduced to ensure future flexibility. </para> <para> See <link linkend="GimpHelpFunc">GimpHelpFunc</link> for the naming conventions of HTML help files. </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>help_data</parameter> :</entry> <entry>A string containing the path to a HTML page. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-help-connect-help-accel">gimp_help_connect_help_accel ()</title> <programlisting>void gimp_help_connect_help_accel (<link linkend="GtkWidget">GtkWidget</link> *widget, <link linkend="GimpHelpFunc">GimpHelpFunc</link> help_func, const <link linkend="gchar">gchar</link> *help_data);</programlisting> <para> Note that this function is automatically called by all libgimp dialog constructors. You only have to call it for windows/dialogs you created "manually". </para> <para> For convenience, <link linkend="gimp-help-connect-help-accel">gimp_help_connect_help_accel</link>() calls <link linkend="gimp-dialog-set-icon">gimp_dialog_set_icon</link>() if the passed widget is a <link linkend="GtkWindow">GtkWindow</link>, so you don't have to worry about this.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>widget</parameter> :</entry> <entry> The widget you want to connect the help accelerator for. Will be a <link linkend="GtkWindow">GtkWindow</link> in most cases. </entry></row> <row><entry align="right"><parameter>help_func</parameter> :</entry> <entry> The function which will be called if the user presses "F1". </entry></row> <row><entry align="right"><parameter>help_data</parameter> :</entry> <entry> The data pointer which will be passed to <parameter>help_func</parameter>. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-help-set-help-data">gimp_help_set_help_data ()</title> <programlisting>void gimp_help_set_help_data (<link linkend="GtkWidget">GtkWidget</link> *widget, const <link linkend="gchar">gchar</link> *tooltip, const <link linkend="gchar">gchar</link> *help_data);</programlisting> <para> The reason why we don't use <link linkend="gtk-tooltips-set-tip">gtk_tooltips_set_tip</link>() is that it's impossible to set a <parameter>private_tip</parameter> (aka <parameter>help_data</parameter>) without a visible <parameter>tooltip</parameter>. </para> <para> This function can be called with <parameter>tooltip</parameter> == <link linkend="NULL-CAPS">NULL</link>. Use this feature if you want to set a HTML help link for a widget which shouldn't have a visible tooltip. </para> <para> You can e.g. set a <parameter>help_data</parameter> string to a complete HTML page for a container widget (e.g. a <link linkend="GtkBox">GtkBox</link>). For the widgets inside the box you can set HTML anchors which point inside the container widget's help page by setting <parameter>help_data</parameter> strings starting with "#". </para> <para> If the tooltips inspector (Shift + "F1") is invoked and the user clicks on one of the widgets which only contain a "#" link, the help system will automatically ascend the widget hierarchy until it finds another widget with <parameter>help_data</parameter> attached and concatenates both to a complete help path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>widget</parameter> :</entry> <entry> The <link linkend="GtkWidget">GtkWidget</link> you want to set a <parameter>tooltip</parameter> and/or <parameter>help_data</parameter> for. </entry></row> <row><entry align="right"><parameter>tooltip</parameter> :</entry> <entry> The text for this widget's tooltip. </entry></row> <row><entry align="right"><parameter>help_data</parameter> :</entry> <entry> The <parameter>help_data</parameter> for the <link linkend="GtkTipsQuery">GtkTipsQuery</link> tooltips inspector. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-context-help">gimp_context_help ()</title> <programlisting>void gimp_context_help (void);</programlisting> <para> This function invokes the <link linkend="GtkTipsQuery">GtkTipsQuery</link> tooltips inspector. </para> <para> The mouse cursor will turn turn into a question mark and the user can click on any widget of the application which started the inspector. </para> <para> If the widget the user clicked on has a <parameter>help_data</parameter> string attached (see <link linkend="gimp-help-set-help-data">gimp_help_set_help_data</link>()), the corresponding HTML page will be displayed. Otherwise the help system will ascend the widget hierarchy until it finds an attached <parameter>help_data</parameter> string (which should be the case at least for every window/dialog).</para> <para> </para></refsect2> </refsect1> </refentry>